﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects
{
    public class AutoID : BusinessObject
    {
        public AutoID()
        {
            AddRule(new ValidateRequired("Prefix"));
            AddRule(new ValidateLength("Prefix", 0, 50));

            AddRule(new ValidateRequired("Value"));

            AddRule(new ValidateRequired("RestaurantID"));
        }

        public AutoID(string autoID, int refTypeId,  string refTypeCategoryName, string prefix, int value,
                        int lengthOfValue, string suffix, string restaurantID)
            : this()
        {
            AutoId = autoID;
            RefTypeName = refTypeCategoryName;
            RefTypeID = refTypeId;
            Prefix = prefix;
            Value = value;
            LengthOfValue = lengthOfValue;
            Suffix = suffix;
            RestaurantID = restaurantID;
        }

        /// <summary>
        /// AutoID tự sinh nên để kiểu Guid 
        /// </summary>
        public string AutoId { get; set; }

        public int RefTypeID { get; set; }

        public string RefTypeName { get; set; }

        public string Prefix { get; set; }

        public int Value { get; set; }

        public int LengthOfValue { get; set; }

        public string Suffix { get; set; }

        /// <summary>
        /// RestaurantID cập nhật theo chuỗi đã có nên sẽ để kiểu string 
        /// </summary>
        public string RestaurantID { get; set; }
    }
}
